package com.gitee.huxing.framework.core.module;

import lombok.Data;

/**
 * @Description: 响应对象
 * @ProjectName: JavaCourse
 * @Package: com.gitee.huxing.framework.core.module
 * @ClassName: ResponseInfo
 * @Author: huxing
 * @DateTime: 2021-09-30 上午9:42
 */
@Data
public class ResponseInfo {

    /** 响应结果 **/
    private Object result;

    /** 响应状态 **/
    private boolean status;

    /** 错误提示 **/
    private Exception exception;

    /**
     * @Description: 基础错误提示
     * @Author: huxing
     * @param ex
     * @return com.gitee.huxing.framework.core.module.ResponseInfo
     * @Date: 2021/10/8 下午12:32
     **/
    public static ResponseInfo error(Exception ex){
        ResponseInfo responseInfo = new ResponseInfo();
        responseInfo.setResult(null);
        responseInfo.setStatus(false);
        responseInfo.setException(ex);
        return responseInfo;
    }
}
